﻿@model projectManagementWeb.Models.Manager.createProjectModel

@{
    ViewBag.Title = "createProject";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<div align="right">
    @Html.ActionLink("<< Regresar", "Index")
</div>


<style type="text/css">
.ui-datepicker { width: 17em; padding: .2em .2em 0; background: #66FF99;}
</style>

<script src="@Url.Content("~/Scripts/jquery-ui-1.8.11.js")" type="text/javascript"></script>
<script type="text/javascript">
    $(document).ready(function () {
        $(".date").datepicker
            ({
                dateFormat: 'mm/dd/yy',
                showStatus: true,
                showWeeks: true,
                highlightWeek: true,
                numberOfMonths: 1,
                showAnim: "scale",
                showOptions: {
                    origin: ["top", "left"]
                }
            });
    });
</script>



@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Crear Proyecto</legend>

        <div class="editor-label">
            @Html.LabelFor(model => model.Name)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Name)
            @Html.ValidationMessageFor(model => model.Name)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Description)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Description)
            @Html.ValidationMessageFor(model => model.Description)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.startDate)
        </div>
        <div class="editor-field">
            @if (Model == null)
            {
                @Html.TextBox("startDate", (DateTime.Now.ToString()), new { @class = "date" })
            }
            else
            {
                @Html.TextBox("startDate", Model.startDate.ToString(), new { @class = "date" })
            }
            @Html.ValidationMessageFor(model => model.startDate)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.endDate)
        </div>
        <div class="editor-field">
                @if (Model == null)
                {
                    @Html.TextBox("endDate", (DateTime.Now.ToString()), new { @class = "date" })
                }
                else
                {
                    @Html.TextBox("endDate",Model.endDate.ToString(), new { @class = "date" })
                }
            @Html.ValidationMessageFor(model => model.endDate)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.projectLeaderID)
        </div>
        <div class="editor-field">
         @Html.DropDownListFor(model => model.projectLeaderID, new SelectList(Model.ProjectLeaderIDList, "Value", "Text",Model.projectLeaderID), null, new { id = "projectLeaderID" }) 
            @Html.ValidationMessageFor(model => model.projectLeaderID)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.sponsorID)
        </div>
        <div class="editor-field">
        @Html.DropDownListFor(model => model.sponsorID, new SelectList(Model.SponsorIDList, "Value", "Text",Model.sponsorID), null, new { id = "sponsorID" })
            @Html.ValidationMessageFor(model => model.sponsorID)
        </div>
        <p>
            <input type="submit" value="Crear" />
        </p>
    </fieldset>
}

